Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CCM-5210]: create an endpoint to fetch instance family information #16

Merged

Conversation

ketankr9
Copy link

@ketankr9 ketankr9 commented Nov 14, 2021

  1. Create a new endpoint to fetch instance series/family informations /:provider/services/:service/regions/:region/series, so that it can be used as a selectable item for assisting in Node Recommendation.
  2. Add support for parsing instance series/family based on provider, add series key in the VMInfo denoting the VM's family.
  3. Add support for unknown instance families to be categorized into General, Compute, Memory etc.

PR Test deployment: https://app.harness.io/#/account/wFHXHD0RRQWoO8tIZT5YVw/app/-jRbnwPZRoOLj2NEhrbJnQ/env/979cAadnRx2Zw2UM-My8pg/executions/MPxOAdRBTtas-rsQvA2KwQ/details

Examples

Azure
Request: curl --location 'http://localhost:8000/api/v1/providers/azure/services/aks/regions/uksouth/series'
Response

{
    "categoryDetails": {
        "Compute optimized": {
            "F": [
                "Standard_F1",
                "Standard_F16",
                "Standard_F2",
                "Standard_F4",
                "Standard_F8"
            ],
            "FS": [
                "Standard_F16s",
                "Standard_F1s",
                "Standard_F2s",
                "Standard_F4s",
                "Standard_F8s"
            ],
            "FSv2": [
                "Standard_F16s_v2",
                "Standard_F2s_v2",
                "Standard_F32s_v2",
                "Standard_F4s_v2",
                "Standard_F64s_v2",
                "Standard_F72s_v2",
                "Standard_F8s_v2"
            ],
            "H": [
                "Standard_H16",
                "Standard_H16m",
                "Standard_H16mr",
                "Standard_H16r",
                "Standard_H8",
                "Standard_H8m"
            ]
        },
        "GPU instance": {
            "NC": [
                "Standard_NC12",
                "Standard_NC24",
                "Standard_NC6"
            ],
            "NCSv3": [
                "Standard_NC12s_v3",
                "Standard_NC24rs_v3",
                "Standard_NC24s_v3",
                "Standard_NC6s_v3"
            ],
            "NV": [
                "Standard_NV12",
                "Standard_NV24",
                "Standard_NV6"
            ]
        },
        "General purpose": {
            "A0_A7": [
                "Standard_A1",
                "Standard_A2",
                "Standard_A3",
                "Standard_A4",
                "Standard_A5",
                "Standard_A6",
                "Standard_A7"
            ],
            "Av2": [
                "Standard_A1_v2",
                "Standard_A2m_v2",
                "Standard_A2_v2",
                "Standard_A4m_v2",
                "Standard_A4_v2",
                "Standard_A8m_v2",
                "Standard_A8_v2"
            ],
            "BS": [
                "Standard_B2ms",
                "Standard_B2s",
                "Standard_B4ms",
                "Standard_B8ms"
            ],
            "DSv2": [
                "Standard_DS11_v2",
                "Standard_DS12_v2",
                "Standard_DS13-2_v2",
                "Standard_DS13-4_v2",
                "Standard_DS13_v2",
                "Standard_DS14-4_v2",
                "Standard_DS14-8_v2",
                "Standard_DS14_v2",
                "Standard_DS15_v2",
                "Standard_DS1_v2",
                "Standard_DS2_v2",
                "Standard_DS3_v2",
                "Standard_DS4_v2",
                "Standard_DS5_v2"
            ],
            "DSv3": [
                "Standard_D16s_v3",
                "Standard_D2s_v3",
                "Standard_D32s_v3",
                "Standard_D4s_v3",
                "Standard_D64s_v3",
                "Standard_D8s_v3"
            ],
            "Dv2": [
                "Standard_D11_v2",
                "Standard_D12_v2",
                "Standard_D13_v2",
                "Standard_D14_v2",
                "Standard_D15_v2",
                "Standard_D1_v2",
                "Standard_D2_v2",
                "Standard_D3_v2",
                "Standard_D4_v2",
                "Standard_D5_v2"
            ],
            "Dv3": [
                "Standard_D16_v3",
                "Standard_D2_v3",
                "Standard_D32_v3",
                "Standard_D4_v3",
                "Standard_D64_v3",
                "Standard_D8_v3"
            ]
        },
        "Memory optimized": {
            "ESv3": [
                "Standard_E16s_v3",
                "Standard_E2s_v3",
                "Standard_E32-16s_v3",
                "Standard_E32-8s_v3",
                "Standard_E32s_v3",
                "Standard_E4s_v3",
                "Standard_E64-16s_v3",
                "Standard_E64-32s_v3",
                "Standard_E64s_v3",
                "Standard_E8s_v3"
            ],
            "Ev3": [
                "Standard_E16_v3",
                "Standard_E2_v3",
                "Standard_E32_v3",
                "Standard_E4_v3",
                "Standard_E64_v3",
                "Standard_E8_v3"
            ],
            "G": [
                "Standard_G1",
                "Standard_G2",
                "Standard_G3",
                "Standard_G4",
                "Standard_G5"
            ],
            "GS": [
                "Standard_GS1",
                "Standard_GS2",
                "Standard_GS3",
                "Standard_GS4",
                "Standard_GS4-4",
                "Standard_GS4-8",
                "Standard_GS5",
                "Standard_GS5-16",
                "Standard_GS5-8"
            ],
            "MS": [
                "Standard_M128-32ms",
                "Standard_M128-64ms",
                "Standard_M128ms",
                "Standard_M128s",
                "Standard_M64-16ms",
                "Standard_M64-32ms",
                "Standard_M64ms",
                "Standard_M64s"
            ]
        },
        "Storage optimized": {
            "LS": [
                "Standard_L16s",
                "Standard_L32s",
                "Standard_L4s",
                "Standard_L8s"
            ]
        }
    },
    "seriesDetails": [
        {
            "series": "Av2",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_A1_v2",
                "Standard_A2m_v2",
                "Standard_A2_v2",
                "Standard_A4m_v2",
                "Standard_A4_v2",
                "Standard_A8m_v2",
                "Standard_A8_v2"
            ]
        },
        {
            "series": "BS",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_B2ms",
                "Standard_B2s",
                "Standard_B4ms",
                "Standard_B8ms"
            ]
        },
        {
            "series": "Dv2",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_D11_v2",
                "Standard_D12_v2",
                "Standard_D13_v2",
                "Standard_D14_v2",
                "Standard_D15_v2",
                "Standard_D1_v2",
                "Standard_D2_v2",
                "Standard_D3_v2",
                "Standard_D4_v2",
                "Standard_D5_v2"
            ]
        },
        {
            "series": "DSv3",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_D16s_v3",
                "Standard_D2s_v3",
                "Standard_D32s_v3",
                "Standard_D4s_v3",
                "Standard_D64s_v3",
                "Standard_D8s_v3"
            ]
        },
        {
            "series": "Dv3",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_D16_v3",
                "Standard_D2_v3",
                "Standard_D32_v3",
                "Standard_D4_v3",
                "Standard_D64_v3",
                "Standard_D8_v3"
            ]
        },
        {
            "series": "DSv2",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_DS11_v2",
                "Standard_DS12_v2",
                "Standard_DS13-2_v2",
                "Standard_DS13-4_v2",
                "Standard_DS13_v2",
                "Standard_DS14-4_v2",
                "Standard_DS14-8_v2",
                "Standard_DS14_v2",
                "Standard_DS15_v2",
                "Standard_DS1_v2",
                "Standard_DS2_v2",
                "Standard_DS3_v2",
                "Standard_DS4_v2",
                "Standard_DS5_v2"
            ]
        },
        {
            "series": "A0_A7",
            "category": "General purpose",
            "instanceTypes": [
                "Standard_A1",
                "Standard_A2",
                "Standard_A3",
                "Standard_A4",
                "Standard_A5",
                "Standard_A6",
                "Standard_A7"
            ]
        },
        {
            "series": "ESv3",
            "category": "Memory optimized",
            "instanceTypes": [
                "Standard_E16s_v3",
                "Standard_E2s_v3",
                "Standard_E32-16s_v3",
                "Standard_E32-8s_v3",
                "Standard_E32s_v3",
                "Standard_E4s_v3",
                "Standard_E64-16s_v3",
                "Standard_E64-32s_v3",
                "Standard_E64s_v3",
                "Standard_E8s_v3"
            ]
        },
        {
            "series": "Ev3",
            "category": "Memory optimized",
            "instanceTypes": [
                "Standard_E16_v3",
                "Standard_E2_v3",
                "Standard_E32_v3",
                "Standard_E4_v3",
                "Standard_E64_v3",
                "Standard_E8_v3"
            ]
        },
        {
            "series": "G",
            "category": "Memory optimized",
            "instanceTypes": [
                "Standard_G1",
                "Standard_G2",
                "Standard_G3",
                "Standard_G4",
                "Standard_G5"
            ]
        },
        {
            "series": "GS",
            "category": "Memory optimized",
            "instanceTypes": [
                "Standard_GS1",
                "Standard_GS2",
                "Standard_GS3",
                "Standard_GS4",
                "Standard_GS4-4",
                "Standard_GS4-8",
                "Standard_GS5",
                "Standard_GS5-16",
                "Standard_GS5-8"
            ]
        },
        {
            "series": "MS",
            "category": "Memory optimized",
            "instanceTypes": [
                "Standard_M128-32ms",
                "Standard_M128-64ms",
                "Standard_M128ms",
                "Standard_M128s",
                "Standard_M64-16ms",
                "Standard_M64-32ms",
                "Standard_M64ms",
                "Standard_M64s"
            ]
        },
        {
            "series": "",
            "category": "Compute optimized",
            "instanceTypes": [
                "Standard_F1",
                "Standard_F16",
                "Standard_F2",
                "Standard_F4",
                "Standard_F8"
            ]
        },
        {
            "series": "FS",
            "category": "Compute optimized",
            "instanceTypes": [
                "Standard_F16s",
                "Standard_F1s",
                "Standard_F2s",
                "Standard_F4s",
                "Standard_F8s"
            ]
        },
        {
            "series": "FSv2",
            "category": "Compute optimized",
            "instanceTypes": [
                "Standard_F16s_v2",
                "Standard_F2s_v2",
                "Standard_F32s_v2",
                "Standard_F4s_v2",
                "Standard_F64s_v2",
                "Standard_F72s_v2",
                "Standard_F8s_v2"
            ]
        },
        {
            "series": "H",
            "category": "Compute optimized",
            "instanceTypes": [
                "Standard_H16",
                "Standard_H16m",
                "Standard_H16mr",
                "Standard_H16r",
                "Standard_H8",
                "Standard_H8m"
            ]
        },
        {
            "series": "LS",
            "category": "Storage optimized",
            "instanceTypes": [
                "Standard_L16s",
                "Standard_L32s",
                "Standard_L4s",
                "Standard_L8s"
            ]
        },
        {
            "series": "NCSv3",
            "category": "GPU instance",
            "instanceTypes": [
                "Standard_NC12s_v3",
                "Standard_NC24rs_v3",
                "Standard_NC24s_v3",
                "Standard_NC6s_v3"
            ]
        },
        {
            "series": "NV",
            "category": "GPU instance",
            "instanceTypes": [
                "Standard_NV12",
                "Standard_NV24",
                "Standard_NV6"
            ]
        },
        {
            "series": "NC",
            "category": "GPU instance",
            "instanceTypes": [
                "Standard_NC12",
                "Standard_NC24",
                "Standard_NC6"
            ]
        }
    ],
    "scrapingTime": "1636902562309"
}

Google
Request:

curl --location --request GET 'http://localhost:8000/api/v1/providers/google/services/gke/regions/us-west1/series'

Response:

{
    "categoryDetails": {
        "Compute optimized": {
            "e2": [
                "e2-highcpu-16",
                "e2-highcpu-8",
                "e2-highcpu-32",
                "e2-highcpu-2",
                "e2-highcpu-4"
            ],
            "n1": [
                "n1-highcpu-8",
                "n1-highcpu-96",
                "n1-highcpu-2",
                "n1-highcpu-64",
                "n1-highcpu-4",
                "n1-highcpu-32",
                "n1-highcpu-16"
            ],
            "n2": [
                "n2-highcpu-64",
                "n2-highcpu-2",
                "n2-highcpu-32",
                "n2-highcpu-80",
                "n2-highcpu-48",
                "n2-highcpu-4",
                "n2-highcpu-8",
                "n2-highcpu-16"
            ],
            "n2d": [
                "n2d-highcpu-16",
                "n2d-highcpu-80",
                "n2d-highcpu-2",
                "n2d-highcpu-8",
                "n2d-highcpu-96",
                "n2d-highcpu-64",
                "n2d-highcpu-4",
                "n2d-highcpu-128",
                "n2d-highcpu-48",
                "n2d-highcpu-32",
                "n2d-highcpu-224"
            ]
        },
        "General purpose": {
            "a2": [
                "a2-highgpu-8g",
                "a2-highgpu-1g",
                "a2-highgpu-4g",
                "a2-highgpu-2g"
            ],
            "c2": [
                "c2-standard-8",
                "c2-standard-60",
                "c2-standard-30",
                "c2-standard-4",
                "c2-standard-16"
            ],
            "e2": [
                "e2-standard-16",
                "e2-standard-32",
                "e2-medium",
                "e2-standard-8",
                "e2-small",
                "e2-standard-2",
                "e2-standard-4",
                "e2-micro"
            ],
            "f1": [
                "f1-micro"
            ],
            "g1": [
                "g1-small"
            ],
            "m1": [
                "m1-ultramem-160",
                "m1-megamem-96",
                "m1-ultramem-80",
                "m1-ultramem-40"
            ],
            "n1": [
                "n1-standard-2",
                "n1-standard-8",
                "n1-standard-4",
                "n1-standard-16",
                "n1-standard-64",
                "n1-standard-1",
                "n1-standard-96",
                "n1-standard-32"
            ],
            "n2": [
                "n2-standard-48",
                "n2-standard-80",
                "n2-standard-8",
                "n2-standard-2",
                "n2-standard-4",
                "n2-standard-64",
                "n2-standard-32",
                "n2-standard-16"
            ],
            "n2d": [
                "n2d-standard-64",
                "n2d-standard-4",
                "n2d-standard-48",
                "n2d-standard-16",
                "n2d-standard-2",
                "n2d-standard-80",
                "n2d-standard-32",
                "n2d-standard-96",
                "n2d-standard-8",
                "n2d-standard-128",
                "n2d-standard-224"
            ]
        },
        "Memory optimized": {
            "e2": [
                "e2-highmem-16",
                "e2-highmem-4",
                "e2-highmem-2",
                "e2-highmem-8"
            ],
            "n1": [
                "n1-highmem-8",
                "n1-highmem-32",
                "n1-highmem-16",
                "n1-highmem-4",
                "n1-highmem-64",
                "n1-highmem-2",
                "n1-highmem-96"
            ],
            "n2": [
                "n2-highmem-16",
                "n2-highmem-4",
                "n2-highmem-48",
                "n2-highmem-80",
                "n2-highmem-2",
                "n2-highmem-32",
                "n2-highmem-8",
                "n2-highmem-64"
            ],
            "n2d": [
                "n2d-highmem-16",
                "n2d-highmem-64",
                "n2d-highmem-2",
                "n2d-highmem-32",
                "n2d-highmem-4",
                "n2d-highmem-8",
                "n2d-highmem-80",
                "n2d-highmem-96",
                "n2d-highmem-48"
            ]
        }
    },
    "seriesDetails": [
        {
            "series": "n2d",
            "category": "General purpose",
            "instanceTypes": [
                "n2d-standard-64",
                "n2d-standard-4",
                "n2d-standard-48",
                "n2d-standard-16",
                "n2d-standard-2",
                "n2d-standard-80",
                "n2d-standard-32",
                "n2d-standard-96",
                "n2d-standard-8",
                "n2d-standard-128",
                "n2d-standard-224"
            ]
        },
        {
            "series": "n1",
            "category": "General purpose",
            "instanceTypes": [
                "n1-standard-2",
                "n1-standard-8",
                "n1-standard-4",
                "n1-standard-16",
                "n1-standard-64",
                "n1-standard-1",
                "n1-standard-96",
                "n1-standard-32"
            ]
        },
        {
            "series": "m1",
            "category": "General purpose",
            "instanceTypes": [
                "m1-ultramem-160",
                "m1-megamem-96",
                "m1-ultramem-80",
                "m1-ultramem-40"
            ]
        },
        {
            "series": "c2",
            "category": "General purpose",
            "instanceTypes": [
                "c2-standard-8",
                "c2-standard-60",
                "c2-standard-30",
                "c2-standard-4",
                "c2-standard-16"
            ]
        },
        {
            "series": "a2",
            "category": "General purpose",
            "instanceTypes": [
                "a2-highgpu-8g",
                "a2-highgpu-1g",
                "a2-highgpu-4g",
                "a2-highgpu-2g"
            ]
        },
        {
            "series": "g1",
            "category": "General purpose",
            "instanceTypes": [
                "g1-small"
            ]
        },
        {
            "series": "f1",
            "category": "General purpose",
            "instanceTypes": [
                "f1-micro"
            ]
        },
        {
            "series": "e2",
            "category": "General purpose",
            "instanceTypes": [
                "e2-standard-16",
                "e2-standard-32",
                "e2-medium",
                "e2-standard-8",
                "e2-small",
                "e2-standard-2",
                "e2-standard-4",
                "e2-micro"
            ]
        },
        {
            "series": "n2",
            "category": "General purpose",
            "instanceTypes": [
                "n2-standard-48",
                "n2-standard-80",
                "n2-standard-8",
                "n2-standard-2",
                "n2-standard-4",
                "n2-standard-64",
                "n2-standard-32",
                "n2-standard-16"
            ]
        },
        {
            "series": "e2",
            "category": "Compute optimized",
            "instanceTypes": [
                "e2-highcpu-16",
                "e2-highcpu-8",
                "e2-highcpu-32",
                "e2-highcpu-2",
                "e2-highcpu-4"
            ]
        },
        {
            "series": "n1",
            "category": "Compute optimized",
            "instanceTypes": [
                "n1-highcpu-8",
                "n1-highcpu-96",
                "n1-highcpu-2",
                "n1-highcpu-64",
                "n1-highcpu-4",
                "n1-highcpu-32",
                "n1-highcpu-16"
            ]
        },
        {
            "series": "n2d",
            "category": "Compute optimized",
            "instanceTypes": [
                "n2d-highcpu-16",
                "n2d-highcpu-80",
                "n2d-highcpu-2",
                "n2d-highcpu-8",
                "n2d-highcpu-96",
                "n2d-highcpu-64",
                "n2d-highcpu-4",
                "n2d-highcpu-128",
                "n2d-highcpu-48",
                "n2d-highcpu-32",
                "n2d-highcpu-224"
            ]
        },
        {
            "series": "n2",
            "category": "Compute optimized",
            "instanceTypes": [
                "n2-highcpu-64",
                "n2-highcpu-2",
                "n2-highcpu-32",
                "n2-highcpu-80",
                "n2-highcpu-48",
                "n2-highcpu-4",
                "n2-highcpu-8",
                "n2-highcpu-16"
            ]
        },
        {
            "series": "n2",
            "category": "Memory optimized",
            "instanceTypes": [
                "n2-highmem-16",
                "n2-highmem-4",
                "n2-highmem-48",
                "n2-highmem-80",
                "n2-highmem-2",
                "n2-highmem-32",
                "n2-highmem-8",
                "n2-highmem-64"
            ]
        },
        {
            "series": "e2",
            "category": "Memory optimized",
            "instanceTypes": [
                "e2-highmem-16",
                "e2-highmem-4",
                "e2-highmem-2",
                "e2-highmem-8"
            ]
        },
        {
            "series": "n1",
            "category": "Memory optimized",
            "instanceTypes": [
                "n1-highmem-8",
                "n1-highmem-32",
                "n1-highmem-16",
                "n1-highmem-4",
                "n1-highmem-64",
                "n1-highmem-2",
                "n1-highmem-96"
            ]
        },
        {
            "series": "n2d",
            "category": "Memory optimized",
            "instanceTypes": [
                "n2d-highmem-16",
                "n2d-highmem-64",
                "n2d-highmem-2",
                "n2d-highmem-32",
                "n2d-highmem-4",
                "n2d-highmem-8",
                "n2d-highmem-80",
                "n2d-highmem-96",
                "n2d-highmem-48"
            ]
        }
    ],
    "scrapingTime": "1636869324811"
}

@ketankr9 ketankr9 force-pushed the utsav/CCM-5210-cloudinfo-populate-instance-familyclass branch from db16fc9 to a3c12ea Compare November 14, 2021 06:30
@ketankr9 ketankr9 force-pushed the utsav/CCM-5210-cloudinfo-populate-instance-familyclass branch from 1f4beb9 to 368eaf4 Compare November 15, 2021 10:41
@ketankr9 ketankr9 merged commit 86e0a3c into master Nov 15, 2021
ketankr9 pushed a commit to wings-software/telescopes that referenced this pull request Nov 15, 2021
ketankr9 pushed a commit to wings-software/telescopes that referenced this pull request Nov 15, 2021
ketankr9 pushed a commit to wings-software/telescopes that referenced this pull request Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants